<template>
		<view class="content">
			<view class="list">
				<view class="row" hover-class="opacity7" @click="openWebView('隐私协议', 'https://gms.imguangguang.com/privacy.html')">
					<view class="title">隐私协议</view>
					<view class="right">
						<view class="icon xiangyou"></view>
					</view>
				</view>
				<view class="row" hover-class="opacity7" @click="openWebView('用户协议', 'https://gms.imguangguang.com/user_privacy.html')">
					<view class="title">用户协议</view>
					<view class="right">
						<view class="icon xiangyou"></view>
					</view>
				</view>
				<view class="row" hover-class="opacity7" @click="toAbout">
					<view class="title">关于陌搭</view>
					<view class="right">
						<view class="tis"></view>
						<view class="icon xiangyou"></view>
					</view>
				</view>
				<view class="row" hover-class="opacity7" @click="toHelp">
					<view class="title">帮助</view>
					<view class="right">
						<view class="tis"></view>
						<view class="icon xiangyou"></view>
					</view>
				</view>
			</view>
			<view class="btn_area mocup_btn" @click="logoutUser">退出登陆</view>
		</view>
</template>

<script>
	import {
		mapMutations
	} from 'vuex'
	import main from '../../../main.js';
	
	export default {
		data() {
			return {

			};
		},
		methods: {
			...mapMutations(['logout']),
			// 退出登陆
			logoutUser() {
				uni.showLoading({
					title: "正在退出"
				})
				this.$u.api.exitLogin().then(res => {
					uni.hideLoading()
					if(res.code === 200) {
						this.logout()
						main.jim.loginOut()
						uni.reLaunch({
							url: '/pages/order/placeOrderIndex'
						})
					}
				})
			},
			openWebView(title, url){
				uni.navigateTo({
					url:"/pagesB/pages/settings/WebViewPage?title="+title+"&url="+url
				});
			},
			toHelp(){
				uni.navigateTo({
					url:"/pagesB/pages/settings/HelpPage"
				});
			},
			toAbout(){
				uni.navigateTo({
					url:"/pagesB/pages/settings/AboutPage"
				});
			}
		}
	}
</script>

<style lang="scss">
	.content {
		height: 100vh !important;
		padding-bottom: 20upx;
	}

	.icon {
		font-size: 30upx;
	}

	.content {
		display: flex;
		flex-direction: column;
		justify-content: space-between;
		height: 100%;
		.list {
			width: 100%;
			padding-left: 30upx;
			background-color: #fff;
			margin-bottom: 20upx;

			.row {
				widows: 100%;
				min-height: 110upx;
				display: flex;
				align-items: center;
				justify-content: space-between;
				border-bottom: solid 1upx #e7e7e7;

				&:last-child {
					border-bottom: none;
				}

				.title {
					font-size: 32upx;
					color: #333333;
				}

				.right {
					display: flex;
					align-items: center;
					color: #999;

					.tis {
						font-size: 26upx;
						margin-right: 5upx;
						max-height: 120upx;

						image {
							width: 100upx;
							height: 100upx;
							border-radius: 100%;
							margin: 10upx 0;
						}
					}

					.icon {
						width: 42upx;
						color: #909090;
					}
				}

			}
		}
	}


	.btn_area {
		width: 184px;
		height: 49px;
		line-height: 49px;
		text-align: center;
		margin: 0 auto;
	}
</style>
